UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+1sTNrSCzHNuAUsUc1Qjs+AB35kkNj3rRzOeZcXeJ0o=' 
WHERE 
  key_id = '8728f8581bb5bd751b186bc070cd366a1218b9f8eb076ae3c686f22da3a96b7c' 
  AND (
    token = '+1sTNrSCzHNuAUsUc1Qjs+AB35kkNj3rRzOeZcXeJ0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030