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