UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd7Z3WCaZIGjdX/la0xpOdAqK5QNP8637fh8E342g2WA='
WHERE
key_id = 'ac0e2001703a9c43db3fe8cb58267b9d33501c0cda4976471fac9dd69a4cb275'
AND (
token = 'd7Z3WCaZIGjdX/la0xpOdAqK5QNP8637fh8E342g2WA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)