UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pq+B/Q1Q3YlHHLd1asz620u7aNRGISHSYSSup58PyqU='
WHERE
key_id = '4e98ae5e794dbaaafb5b27dcdca4fbaab957f14010d2ef170368cc87313779ec'
AND (
token = 'pq+B/Q1Q3YlHHLd1asz620u7aNRGISHSYSSup58PyqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)