UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PITB7lM/3c4S1jjyY31M0zeqQuBe3ELSuQ4ERhQwKAU='
WHERE
key_id = '79b2d1f3ecf055fb57147470aac9d8223bcc3670d7444fcb80dd062192cd8285'
AND (
token = 'PITB7lM/3c4S1jjyY31M0zeqQuBe3ELSuQ4ERhQwKAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)