UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Be/HftKxvSOMOOBWNXfCvWGbR5t0QS/nUmbOXUZeJxQ=' 
WHERE 
  key_id = 'ffab8b9730c4b0e7b60f2fdca3656a70c36a8228ad8888d470930e2208dccd6c' 
  AND (
    token = 'Be/HftKxvSOMOOBWNXfCvWGbR5t0QS/nUmbOXUZeJxQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037