UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JRl9yHc2fx9m6L4Ns1RAuHm55dFS2d+VNM+1BkADp6g=' 
WHERE 
  key_id = 'a9e3e7f2fe0bc10a64983f12ac6c80a3e59a446fbecdb8c156e5da82db7215cc' 
  AND (
    token = 'JRl9yHc2fx9m6L4Ns1RAuHm55dFS2d+VNM+1BkADp6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031