UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UW7fFaE1L9sQDmT5hY4mD4jff6S3prOLzwvEUmqjb6k='
WHERE
key_id = '49f5a8b088e61270f10b537cdcaa959a21da681d940b4ac824f81760372bc7cf'
AND (
token = 'UW7fFaE1L9sQDmT5hY4mD4jff6S3prOLzwvEUmqjb6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)