UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rphNhDeha2fwvyAkNmZOAqseE5RNeI1VBUrCUerI3LY='
WHERE
key_id = '029963ffd88a817e3bceb74baaf67710e871064b7082564aeba96aad68110251'
AND (
token = 'rphNhDeha2fwvyAkNmZOAqseE5RNeI1VBUrCUerI3LY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)