UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4hcok+7yxldGgWxmQLi8W8gOxT/tAgKUfXIsAT7IvGY='
WHERE
key_id = '03abdf6b4f8116822d49ab23a841291365e7667fc561e6f5eb600685c447b7fa'
AND (
token = '4hcok+7yxldGgWxmQLi8W8gOxT/tAgKUfXIsAT7IvGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)