UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rwhoHn7HV7Awf9Y8Hjwh2wtHlIDLqnEZ/MVrRadf1JM='
WHERE
key_id = '240ca35d32e325cc495415962c932ea9ed67946a082217a74dc03ba351d1a5f0'
AND (
token = 'rwhoHn7HV7Awf9Y8Hjwh2wtHlIDLqnEZ/MVrRadf1JM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)