UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MknXxHWwYMma3OUWPIMt659dyq6xXdPJbqceAdpWjuY='
WHERE
key_id = 'caf357fc8349befa055b430a88cc9c233d8ac8740549abcba221ea145df1f9b3'
AND (
token = 'MknXxHWwYMma3OUWPIMt659dyq6xXdPJbqceAdpWjuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)