UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hW4ALhKUL7zAOVUlZN4/E7rz6v+qiXyROWWL9hPw7eA='
WHERE
key_id = 'b8960ba29944d277ff1a9fcc0f4c3e195917607fc5577454654b63bc7fbec728'
AND (
token = 'hW4ALhKUL7zAOVUlZN4/E7rz6v+qiXyROWWL9hPw7eA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)