UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v17Tk3bUYEnlCO+rWRR3e5Mb8q66Xsn3ikB7R98alaM='
WHERE
key_id = '0aa0c91b9145c8fc40e6287adf5f6aa880ed2ec9e94ce7a30e9e40ab28ff3835'
AND (
token = 'v17Tk3bUYEnlCO+rWRR3e5Mb8q66Xsn3ikB7R98alaM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)