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