UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eiCEJYlC8Vhx4IvPOGz+AcyySfDjGf7N+wMo8QXAJf0='
WHERE
key_id = '28cd98970615a044dd71b6b2fc3a0dbf8133748ecc1514d2e3d5064cb6fbaa7d'
AND (
token = 'eiCEJYlC8Vhx4IvPOGz+AcyySfDjGf7N+wMo8QXAJf0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)