UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4tDvhWPpY8zshhSiGSV10J3qjWWFPy7QIYGFkBMUBZM='
WHERE
key_id = 'fc911f22ff3c049dd4f13ea3870fd11178cceb5692dc29a9fbb246de067196a8'
AND (
token = '4tDvhWPpY8zshhSiGSV10J3qjWWFPy7QIYGFkBMUBZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)