UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iQOPM4Il52yKOmkR/nFZ0fh5JhKk0a21pMILP7prwms='
WHERE
key_id = '1d1618dcea59c369e8bf5f34fc682b79368092db580f5fd93d863d17769eb411'
AND (
token = 'iQOPM4Il52yKOmkR/nFZ0fh5JhKk0a21pMILP7prwms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)