UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O4qCz1/mYBqzxv5jnXFQHCtROqH1szMJo4p2sotDThA='
WHERE
key_id = '078dfc1c5c1adc01659d6d5c569b1127af09ff3faa642a7dafca0a7c7c2adb52'
AND (
token = 'O4qCz1/mYBqzxv5jnXFQHCtROqH1szMJo4p2sotDThA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)