UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jspXTOCD+tvlFyVbXEqLuRqsDrnD1wiBkyHsrbDsTrY='
WHERE
key_id = '13af3d6d6052c151fbdb1a74d24b6724279870e8572f54e004c7403e7f3c10cd'
AND (
token = 'jspXTOCD+tvlFyVbXEqLuRqsDrnD1wiBkyHsrbDsTrY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)