UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'icgPaoBOO/+dqz4X1qLrF1Pf39eb+Si4acLpYaQoQeU=' 
WHERE 
  key_id = '761acd212eba87c0951d646a3a70cd5f1d5f388b35d1d5aba896d2a0813d1677' 
  AND (
    token = 'icgPaoBOO/+dqz4X1qLrF1Pf39eb+Si4acLpYaQoQeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036