UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MTGcOsdlCX665BgCb6paYugMQI1lIgJkdpjpp/7ZnVg=' 
WHERE 
  key_id = '2c84033d7675bdd0270a703ce34151ded23d04bae2181502c4e424a51a9e9733' 
  AND (
    token = 'MTGcOsdlCX665BgCb6paYugMQI1lIgJkdpjpp/7ZnVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044