UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nPDGAabFSOfpKN24ywU2xojGXBCpNtX6Ulub4Izg+zQ=' 
WHERE 
  key_id = 'd3b004ca6472a2bb7220194bde00071bbaeed01a0182ce75c8ee7bc42f029710' 
  AND (
    token = 'nPDGAabFSOfpKN24ywU2xojGXBCpNtX6Ulub4Izg+zQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031