UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nCHJoM/NwdWfHNGgqD8aUFtw99yzligE3k8isUnjDsQ=' 
WHERE 
  key_id = '1c3de6cb56551872742734e7db95127d4cbc72fa37512bfea2ee3cdaf0311909' 
  AND (
    token = 'nCHJoM/NwdWfHNGgqD8aUFtw99yzligE3k8isUnjDsQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042