UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fiQQK/P3Lg228uhVxZ8YzpXQ74hhgTCb/sk8Rte2FCA='
WHERE
key_id = 'fd1ee792df0e9252a42cfd15dec4a18185d443cf04e65bfaa212db2456873b5f'
AND (
token = 'fiQQK/P3Lg228uhVxZ8YzpXQ74hhgTCb/sk8Rte2FCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)