UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ooM7BfqpbuBAIngk54DT2AQU7bGzpnCLuhCi3ke2dYA='
WHERE
key_id = '1e1577a75a907a6f1c8310d2dfb6abc83a6d832ba89013b34ccbc7505bf0dd03'
AND (
token = 'ooM7BfqpbuBAIngk54DT2AQU7bGzpnCLuhCi3ke2dYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)