UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B1Y+a44mzas63XcDEbcdbXNV5oEKr128e3kGCII7sLw='
WHERE
key_id = '99f7c082b1c19ff95d90a57e2f22783e9466152a2cd5e4c1490d2d039c99b1df'
AND (
token = 'B1Y+a44mzas63XcDEbcdbXNV5oEKr128e3kGCII7sLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)