UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'meTDeOQDi2CWKjdmKIH7nU9MRb30u+Re+vTqOZI01yc='
WHERE
key_id = '90ec53c1c04aafdc4159ff9c60b1928808bd324d31dfdcefb444572e29b28b52'
AND (
token = 'meTDeOQDi2CWKjdmKIH7nU9MRb30u+Re+vTqOZI01yc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)