UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MXg+9d9pukTWMrQTKT/s3D/04hFDL7zXZ6WZ4PIVcdI='
WHERE
key_id = 'a0681718c25bb9488aa8f056cbbe589d5f965e5fc644df6dc4cc9b357e237b9d'
AND (
token = 'MXg+9d9pukTWMrQTKT/s3D/04hFDL7zXZ6WZ4PIVcdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)