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