UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eICyIwLF8sxDI3tK8rMZzvOXgnAtACDW9LMxwFD4Dko='
WHERE
key_id = '0cb84e0c366f26a84d1dc3e11c0c707c9a8158eeb24c8f62a09c32e87ad2e3b6'
AND (
token = 'eICyIwLF8sxDI3tK8rMZzvOXgnAtACDW9LMxwFD4Dko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)