UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fAME6yzK9VLoYhuB/wJir2TP97LSsS7pcsy0O+OPzjQ=' 
WHERE 
  key_id = '19260a3e8058b97696d16d2e6018d6a247c0865ccf2bb9da70baae6599004288' 
  AND (
    token = 'fAME6yzK9VLoYhuB/wJir2TP97LSsS7pcsy0O+OPzjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052