UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R4HfZjxGBcBHAPfdqGfTcuDz/WA0fsZ42Kg77oj69tc='
WHERE
key_id = 'f7a1128546d11a9c99ca99a6c0e4d6602d55c772ffc5f352e3cbd0e8b0d5248e'
AND (
token = 'R4HfZjxGBcBHAPfdqGfTcuDz/WA0fsZ42Kg77oj69tc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)